package com.NetSunWeiQin.chapter06.echoServer;

import java.net.*;

/**
 *
 * 协议处理器工厂 ，主要负责创建与协议相关的 URLStreamHandler 对象
 *
 * */
public class EchoURLStreamHandlerFactory implements URLStreamHandlerFactory {



    public URLStreamHandler createURLStreamHandler(String protocol) {
        if (protocol.equals("echo"))
            return new EchoURLStreamHandler();
        else
            return null;
    }
}

